<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>StoreOrder</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            <span class="type">Class</span>
            StoreOrder
            
                <span class="parent">&lt;
                    
                    <a href="ApplicationRecord.html">ApplicationRecord</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../files/app/models/store_order_rb.html">app/models/store_order.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>A</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-c-amount_by_month">amount_by_month</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-cancelable">cancelable</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>F</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-format_created_at">format_created_at</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-items_count">items_count</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>O</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-order_push">order_push</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>P</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-pay_status_i18n">pay_status_i18n</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>S</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-status_i18n">status_i18n</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>T</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-to_mail-21">to_mail!</a>,
              </li>
            
              
              <li>
                <a href="#method-i-to_process-21">to_process!</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-amount_by_month">
            
              <b>amount_by_month</b>(month = Time.now)
            
            <a href="../classes/StoreOrder.html#method-c-amount_by_month" name="method-c-amount_by_month" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-c-amount_by_month_source')" id="l_method-c-amount_by_month_source">show</a>
                
              </p>
              <div id="method-c-amount_by_month_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 78</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">amount_by_month</span>(<span class="ruby-identifier">month</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>)
  <span class="ruby-identifier">by_month</span>(<span class="ruby-identifier">month</span>).<span class="ruby-identifier">complete</span>.<span class="ruby-identifier">sum</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:amount</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-cancelable">
            
              <b>cancelable</b>()
            
            <a href="../classes/StoreOrder.html#method-i-cancelable" name="method-i-cancelable" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-cancelable_source')" id="l_method-i-cancelable_source">show</a>
                
              </p>
              <div id="method-i-cancelable_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 74</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">cancelable</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pending?</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">confirming?</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-format_created_at">
            
              <b>format_created_at</b>()
            
            <a href="../classes/StoreOrder.html#method-i-format_created_at" name="method-i-format_created_at" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-format_created_at_source')" id="l_method-i-format_created_at_source">show</a>
                
              </p>
              <div id="method-i-format_created_at_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 70</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">format_created_at</span>
  <span class="ruby-identifier">created_at</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-items_count">
            
              <b>items_count</b>()
            
            <a href="../classes/StoreOrder.html#method-i-items_count" name="method-i-items_count" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-items_count_source')" id="l_method-i-items_count_source">show</a>
                
              </p>
              <div id="method-i-items_count_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">items_count</span>
  <span class="ruby-identifier">items</span>.<span class="ruby-identifier">showable</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value">:id</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-order_push">
            
              <b>order_push</b>()
            
            <a href="../classes/StoreOrder.html#method-i-order_push" name="method-i-order_push" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-order_push_source')" id="l_method-i-order_push_source">show</a>
                
              </p>
              <div id="method-i-order_push_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 22</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">order_push</span>
  <span class="ruby-constant">OrderBroadcastJob</span>.<span class="ruby-identifier">perform_now</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">store_id</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-pay_status_i18n">
            
              <b>pay_status_i18n</b>()
            
            <a href="../classes/StoreOrder.html#method-i-pay_status_i18n" name="method-i-pay_status_i18n" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-pay_status_i18n_source')" id="l_method-i-pay_status_i18n_source">show</a>
                
              </p>
              <div id="method-i-pay_status_i18n_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 61</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">pay_status_i18n</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">pay_status</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;pay_pending&quot;</span>
    <span class="ruby-string">&quot;未支付&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;pay_finished&quot;</span>
    <span class="ruby-string">&quot;已支付&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-status_i18n">
            
              <b>status_i18n</b>()
            
            <a href="../classes/StoreOrder.html#method-i-status_i18n" name="method-i-status_i18n" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-status_i18n_source')" id="l_method-i-status_i18n_source">show</a>
                
              </p>
              <div id="method-i-status_i18n_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 44</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">status_i18n</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">status</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;pending&quot;</span>
    <span class="ruby-string">&quot;待处理&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;confirming&quot;</span>
    <span class="ruby-string">&quot;已确认&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;processing&quot;</span>
    <span class="ruby-string">&quot;处理中&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;mailing&quot;</span>
    <span class="ruby-string">&quot;已发货&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;finished&quot;</span>
    <span class="ruby-string">&quot;收货完成&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;cancel&quot;</span>
    <span class="ruby-string">&quot;已取消&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-to_mail-21">
            
              <b>to_mail!</b>()
            
            <a href="../classes/StoreOrder.html#method-i-to_mail-21" name="method-i-to_mail-21" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-to_mail-21_source')" id="l_method-i-to_mail-21_source">show</a>
                
              </p>
              <div id="method-i-to_mail-21_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 37</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">to_mail!</span>
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">processing?</span>
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">to_process!</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">mailing!</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-to_process-21">
            
              <b>to_process!</b>()
            
            <a href="../classes/StoreOrder.html#method-i-to_process-21" name="method-i-to_process-21" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-to_process-21_source')" id="l_method-i-to_process-21_source">show</a>
                
              </p>
              <div id="method-i-to_process-21_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/models/store_order.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">to_process!</span>
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pending?</span>
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pending!</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">processing!</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>
